<template>
  <div class="app-container">
    <el-steps :active="2" align-center>
      <el-step title="创建任务"></el-step>
      <el-step title="分配任务"></el-step>
    </el-steps>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['enterCheckProject:enterCheckProject:add']"
          >新增</el-button
        >
      </el-col>
    </el-row>

    <el-table v-loading="loading" :data="enterCheckProjectList">
      <el-table-column label="序号" align="center" prop="id" />
      <el-table-column
        label="企业检查ID"
        align="center"
        prop="bizEnterCheckId"
      />
      <el-table-column label="分组名称" align="center" prop="groupName" />
      <el-table-column label="检查组长" align="center" prop="groupLeader" />
      <el-table-column label="参检人员" align="center" prop="groupMember" />
      <el-table-column
        label="计划开始检查时间"
        align="center"
        prop="planStartTime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.planStartTime, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="计划检查结束时间"
        align="center"
        prop="planEndTime"
        width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.planEndTime, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="检查项目" align="center" prop="checkProjectIds" />
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['enterCheckProject:enterCheckProject:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <!-- 添加或修改企业检查-项目对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listEnterCheckProject,
  getEnterCheckProject,
  delEnterCheckProject,
  addEnterCheckProject,
  updateEnterCheckProject,
} from "@/api/biz/enterCheckProject/enterCheckProject";

export default {
  name: "EnterCheckProject",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 企业检查-项目表格数据
      enterCheckProjectList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询企业检查-项目列表 */
    getList() {
      this.loading = true;
      listEnterCheckProject(this.queryParams).then((response) => {
        this.enterCheckProjectList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.open = true;
      this.title = "添加企业检查-项目";
    },
    /** 提交按钮 */
    submitForm() {},
    /** 删除按钮操作 */
    handleDelete(row) {},
  },
};
</script>
